package com.minivision.sdktestdemo.theme.ui;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Switch;

import com.minivision.sdktestdemo.theme.utils.CustomThemeInterface;
import com.minivision.sdktestdemo.theme.utils.ViewAttributeUtils;

/**
 * Created by Administrator on 2016/6/21.
 * 功能暂时没有完成
 */
public class CustomThemeSwitch extends Switch implements CustomThemeInterface {
    private int attrSwitchColor = -1;

    public CustomThemeSwitch(Context context) {
        super(context);
    }

    public CustomThemeSwitch(Context context, AttributeSet attrs) {
        super(context, attrs);
        attrSwitchColor = ViewAttributeUtils.getAccentColorAttribute(attrs);
    }

    public CustomThemeSwitch(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        attrSwitchColor = ViewAttributeUtils.getAccentColorAttribute(attrs);
    }

    @Override
    public View getView() {
        return this;
    }

    @Override
    public void setTheme(Resources.Theme themeId) {
//        attrSwitchColor = Color.BLACK;
//        if (attrSwitchColor != -1) {
//            ViewAttributeUtils.applySwitchColor(this, themeId, attrSwitchColor);
//        }
    }
}
